<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title></title>
</head>
<body>
<div class="contant">
<div class="row">
        <div class="top">首页>审批申请</div>
        <div class="content addapply">
            <div class="box larg-box">
            <form action="{:U('MatApply/addInfo_second')}" method='post' id='add_advance'  enctype="multipart/form-data">
                <h1>垫资资料补录<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="row">
                        <label>车架号: <i class="required">*</i></label>
                        <input type="text" style="width: 180px;" name="vin" value="{$info.vin}" maxlength="17">
                        <label style="width: 13%">底盘号后六位: <i class="required">*</i></label>
                        <input type="text" name="six" value='{$info.chassis_number_six}' maxlength="6">
                        <label>发动机号: <i class="required">*</i></label>
                        <input type="text" name="engine_no" value='{$info.engine_no}' >
                    </div>
                    <div class="row">
                    <label>上传照片: <i class="required">*</i></label>
                    </div>
                    <div class="row">
                         <label class="inputfile" for="">
                            <input class="upload" name="frist_voucher_img" accept="image/*" type="file" style="display: none"/><i>首付款凭证</i>
                            <img class="pic" src="<?php echo empty($info['frist_voucher_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['frist_voucher_img']?>" width='142' height="120" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="bill_img" accept="image/*" type="file" style="display: none"/><i>发票</i>
                            <img class="pic" src="<?php echo empty($info['bill_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['bill_img']?>" width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="warranty_img" accept="image/*" type="file" style="display: none"/><i>商业险保单</i>
                            <img class="pic" src="<?php echo empty($info['warranty_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['warranty_img']?>"  width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="warranty2_img" accept="image/*" type="file" style="display: none"/><i>交强险保单</i>
                            <img class="pic" src="<?php echo empty($info['warranty2_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['warranty2_img']?>"  width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="certificate_img" accept="image/*" type="file" style="display: none"/><i>合格证</i>
                            <img class="pic" src="<?php echo empty($info['certificate_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['certificate_img']?>"  width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="registration_img" accept="image/*" type="file" style="display: none"/><i>登记证</i>
                            <img class="pic" src="<?php echo empty($info['registration_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['registration_img']?>"  width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="warranty3_img" accept="image/*" type="file" style="display: none"/><i>商业险批单</i>
                            <img class="pic" src="<?php echo empty($info['warranty3_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['warranty3_img']?>"  width='142' height="120">
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="warranty4_img" accept="image/*" type="file" style="display: none"/><i>交强险批单</i>
                            <img class="pic" src="<?php echo empty($info['warranty4_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['warranty4_img']?>"  width='142' height="120">
                        </label>
                        <if condition="$carInfo['car_type'] eq 0">
                            <label class="inputfile" for="">
                                <input class="upload" name="tariff_img" accept="image/*" type="file" style="display: none"/><i>关单</i>
                                <img class="pic" src="<?php echo empty($info['tariff_img'])?'__PUBLIC__/Common/images/default_upload.png':$info['tariff_img']?>"  width='142' height="120">
                            </label>
                        </if>
                    </div>
                    <div class="row">
                        <!--<label>法院查询: <i class="required">*</i></label>-->
                        <a href='http://zhixing.court.gov.cn/search/' target="_blank"><input type="button" class="button01" value="法院查询链接" name=""></a>
                         <!--<label>发票真伪查询: <i class="required">*</i></label>-->
                        <a href='https://inv-veri.chinatax.gov.cn/' target="_blank"><input type="button" class="button01" value="发票真伪查询链接" name=""></a>
                    </div>

                    <div class="box">
                        <div class="list-block">
                            <input type='hidden' name="user_id" value='{$Think.get.user_id}'/>
                            <input type="button" class="button01" id='tijiao' value="提交" name="">
                            <input type="button" class="button01" id='cancel' value="暂不提交" name="">
                        </div>
                    </div>
                </div>

            </div>
            </form>
        </div>
    </div>
</div>
    <script src="__PUBLIC__/Admin/js/imgUp.js"></script>
    <script src="{:COM}js/ajaxfileupload.js"></script>
    <script type="text/javascript">
        $('#tijiao').click(function(){
            if ($("input[name='vin']").val()=='') {
               return false;
            }else if ($("input[name='chassis_number_six']").val()=='') {
               return false;
            }else if ($("input[name='engine_no']").val()=='') {
               return false;
            }
            $('#add_advance').submit();
        });

      $('#cancel').click(function(){
         location.href='{:U("MatApply/add_info")}';
      });
    $(function() {
        $("i").click(function (elm) {

        $(this).siblings('.upload').click();//隐藏了input:file样式后，点击头像就可以本地上传
        $(this).siblings('.upload').on("change",function(){
            var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
            if (objUrl) {
            $(this).siblings('.pic').attr("src", objUrl) ; //将图片路径存入src中，显示出图片
            }
            });
        });
    });
     
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
        url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
        url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
        url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }

    </script>
</body>
</html>